#include "../../ACUAS/ACUAS.h"

											// Simple electronic dice

PROGRAM_INIT
	RANDOM_INIT								// initialize the random number generator
	VAR(dice)								// define a 8 bit variable with the name dice

PROGRAM_START
	dice = RANDOM(1,6);						// generate a random number between 1 an 6
	if(dice>=1) LED_ON(1) else LED_OFF(1)	// switch on the appropriate number of LEDs
	if(dice>=2) LED_ON(2) else LED_OFF(2)
	if(dice>=3) LED_ON(3) else LED_OFF(3)
	if(dice>=4) LED_ON(4) else LED_OFF(4)
	if(dice>=5) LED_ON(5) else LED_OFF(5)
	if(dice>=6) LED_ON(6) else LED_OFF(6)

	WAIT_FOR_BUTTON(1)						// wait until button 1 was pressed and released
	WAIT_FOR_RELEASE_BUTTON(1)

PROGRAM_END
